<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
</head>
<body>
<div>
    <h1>基金每日计算</h1>
</div>

<div>
    <h2>添加当天金额</h2>
    <form th:action="@{/add}" method="post">

        基金产品名称:<input type="text" name="productName"><br>
        本金:<input type="text" name="principal" ><br>
        当天收益率<input type="text" name="plrate" ><br>
        预期收益目标:<input type="text" name="expectMoney"><br>

        <input type="submit" value="提交">
    </form>

</div>





<div>
    <table border="1">
        <tr>
            <th>id</th>
            <th>产品名称</th>
            <th>本金</th>
            <th>当天收益率</th>
            <th>预期收益目标</th>
            <th>当天需要补仓金额</th>
            <th>添加日期</th>
            <th>操作</th>
        </tr>

        <tr th:each="collect : ${collects}">
            <td th:text="${collect.id}"></td>
            <td th:text="${collect.productName}"></td>
            <td th:text="${collect.principal}"></td>
            <td th:text="${collect.plrateStr}"></td>
            <td th:text="${collect.expectMoney}"></td>
            <td th:text="${collect.repairMoney}"></td>
            <td th:text="${#dates.format(collect.createTime, 'yyyy-MM-dd')}"></td>
            <td ><button οnclick="appPost()">删除</button></td>
        </tr>
    </table>


</div>

<script>
    $(function () {
        function appPost(id) {
            console.log(id);
            $.ajax({
                url: "/greet",
                data: {name: 'id'},
                type: "POST",
                dataType: "json",
                success: function(data) {

                }
            });}
    })



</script>

</body>
</html>
